package cn.zust.ly.EyExample.Ey11;

import java.util.Scanner;

public class Test {
	public static void main2(String[] args) {
		char a = 'a';
		char b = 'b';
		String str = "";
		str = a+b+str;
		System.out.println(str);
		System.out.println(String.valueOf(a) + String.valueOf(b));
	}
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		
		int x = Integer.parseInt(str, 16);
		System.out.println(x);
	}
}
